home *** CD-ROM | disk | FTP | other *** search
/ Joystick Magazine 1995 July & August / cd No4 joystick No62.iso / mac / pc / SHARE / LIGHTLIB / LANGUAGE.Z / LLI.H < prev    next >
C/C++ Source or Header  |  1995-02-17  |  9KB  |  191 lines

  1. #include "llo.h"
  2.  
  3. // LIBRARY
  4. #define LLO_LIBRARY_IMAGE               0x01000000
  5.  
  6. // CLASSES
  7. #define LLI_CLASS_APPLICATION           LLO_LIBRARY_IMAGE + 0x000000
  8. #define LLI_CLASS_IMAGE                 LLO_LIBRARY_IMAGE + 0x010000
  9.  
  10. // IMAGE APPLICATION
  11. #define LLI_APPLICATION_VERSION         LLI_CLASS_APPLICATION + 0x0001
  12. #define LLI_APPLICATION_IDLE            LLI_CLASS_APPLICATION + 0x0101
  13. #define LLI_APPLICATION_IDLE_REPEAT     LLI_CLASS_APPLICATION + 0x0102
  14.  
  15. // IMAGE CLASS
  16. #define LLI_IMAGE_WIDTH                 LLI_CLASS_IMAGE + 0x0001
  17. #define LLI_IMAGE_HEIGHT                LLI_CLASS_IMAGE + 0x0002
  18. #define LLI_IMAGE_COLORS                LLI_CLASS_IMAGE + 0x0003
  19. #define LLI_IMAGE_DENSITY               LLI_CLASS_IMAGE + 0x0004
  20. #define LLI_IMAGE_BITS                  LLI_CLASS_IMAGE + 0x0005
  21.  
  22.  
  23. // Memory devices types  ------------------------------------------------------
  24. #define LLI_MEMORY                      1   // Memory Device
  25. #define LLI_MEMORY_BW                   1   // 1 bit  / pixels
  26. #define LLI_MEMORY_16                   4   // 4 bits / pixels
  27. #define LLI_MEMORY_256                  8   // 8 bits / pixels
  28. #define LLI_MEMORY_16M                  24  //24 bits / pixels
  29.  
  30.  
  31.  
  32. // Screen devices types  ------------------------------------------------------
  33. #define LLI_SCREEN                      2   // Screen Device
  34. #define LLI_SCREEN_WINDOW_HANDLE        100 // Screen Device / Windows
  35. #define LLI_SCREEN_DEVICE_CONTEXT       200 // Screen Device / Device Context
  36.             
  37. #define LLI_SCREEN_DESKTOP              1
  38. #define LLI_SCREEN_WINDOW               2
  39. #define LLI_SCREEN_CLIENT_AREA          3
  40.  
  41. // Disk devices types  --------------------------------------------------------
  42. #define LLI_DISK                        3   // Disk device
  43. #define LLI_DISK_BMP                    100 // BMP file format
  44. #define LLI_DISK_TIF                    200 // TIF file format
  45. #define LLI_DISK_PCX                    300 // PCX file format
  46. #define LLI_DISK_GIF                    400 // GIF file format
  47. #define LLI_DISK_JPG                    500 // JPG file format
  48.  
  49.  
  50.                                             //                            ƒø      | IMAGE | IMAGE |  LLIBI  |
  51.                                             // Mono-color-lib availability √ƒƒ>   |  B&W  | COLOR | VERSION |
  52.                                             //                            ƒŸ      |       |       |         |
  53. #define LLI_DISK_COMPRESS_NIL             1 // No compression for BMP or TIF      |  YES  |  YES  | STD-PRO |
  54. #define LLI_DISK_COMPRESS_AUTO          000 // Automatic best compression format  |  YES  |  YES  | STD-PRO |
  55. #define LLI_DISK_COMPRESS_RLE           100 // Run lenght encoding for TIF or PCX |  YES  |  YES  | STD-PRO |
  56. #define LLI_DISK_COMPRESS_CCITT1D       110 // Modified Huffman for TIF           |  YES  |  NO   | STD-PRO |
  57. #define LLI_DISK_COMPRESS_PCKBIT        120 // Packed bits      for TIF           |  YES  |  NO   | STD-PRO |
  58. #define LLI_DISK_COMPRESS_CCITTG3       130 // Group 3 for TIF 1D                 |  YES  |  NO   |     PRO |
  59. #define LLI_DISK_COMPRESS_CCITTG4       140 // Group 4 for TIF                    |  YES  |  NO   |     PRO |
  60. #define LLI_DISK_COMPRESS_LZW           160 // Lempel for TIF                     |  YES  |  YES  |     PRO |
  61. #define LLI_DISK_COMPRESS_JPEG          170 // JPEG for JPG                       |  NO   |  YES  |     PRO |
  62.  
  63.  
  64. // Printer devices types  -----------------------------------------------------
  65. #define LLI_PRINTER                     4   // Printer device
  66.  
  67. #define LLI_PRINTER_LPT1                1   // Print to LPT1
  68. #define LLI_PRINTER_LPT2                2   // Print to LPT2
  69. #define LLI_PRINTER_LPT3                3   // Print to LPT3
  70.  
  71. // Scanner devices types  -----------------------------------------------------
  72. #define LLI_SCANNER                     5   // Scanning device
  73. #define LLI_SCANNER_HP_BW               100 // HP SCANJET Black & White
  74. #define LLI_SCANNER_HP_DITHERED_4       110 // HP SCANJET dithering 4x4 Text
  75. #define LLI_SCANNER_HP_DITHERED_8       111 // HP SCANJET dithering 8x8 Photos
  76. #define LLI_SCANNER_HP_GRAY_256         120 // HP SCANJET 256 Gray Levels
  77. #define LLI_SCANNER_HP_COLOR_256        130 // HP SCANJET 256 Colors
  78. #define LLI_SCANNER_TWAIN               200 // Twain
  79.  
  80. // Multi purposes -------------------------------------------------------------
  81. #define LLI_FULL_SIZE                   -1      // Mean max size for a document
  82.  
  83. #define LLI_DPI_75                      75      //   75 Dots per inches density
  84. #define LLI_DPI_100                     100     //  100 Dots per inches density
  85. #define LLI_DPI_150                     150     //  150 Dots per inches density
  86. #define LLI_DPI_300                     300     //  300 Dots per inches density
  87. #define LLI_DPI_600                     600     //  600 Dots per inches density
  88. #define LLI_DPI_1200                    1200    // 1200 Dots per inches density
  89.  
  90. // Idle call modes  ------------------------------------------------------------
  91. #define LLI_IDLE_INIT                   10      // Init phase for a Light Lib Images function execution
  92. #define LLI_IDLE_IDLE                   20      // Idle phase for a Light Lib Images function execution
  93. #define LLI_IDLE_EXIT                   30      // Exit phase for a Light Lib Images function execution
  94.  
  95. // Idle return modes
  96. #define LLI_IDLE_CONT                   1       // Idle function continue message for Light Lib Images functions
  97. #define LLI_IDLE_ABORT                  0       // Idle function abort message for Light Lib Images functions
  98.  
  99. // Action caller defines
  100. #define LLI_CALLER_GET                  10      //
  101. #define LLI_CALLER_PUT                  20      //
  102. #define LLI_CALLER_COPY                 30      //
  103.  
  104. // iCopy Modes
  105. #define LLI_COPY_CLONE                  10      // iCopy() clone     message
  106. #define LLI_COPY_ZOOM                   20      // iCopy() zoom      message
  107. #define LLI_COPY_TURN                   30      // iCopy() turn      message
  108. #define LLI_COPY_QUANTIZE               40      // iCopy() Quantize  message
  109.  
  110. #define LLI_SCALE_GRAY                  50      
  111. #define LLI_SCALE_COLOR                 51
  112.  
  113. #define LLI_DITHER_ON                   60
  114. #define LLI_DITHER_OFF                  61
  115.  
  116. #define LLI_TURN_90                     90      // iCopy(LLI_COPY_TURN)  90¯
  117. #define LLI_TURN_180                    180     // iCopy(LLI_COPY_TURN) 180¯
  118. #define LLI_TURN_270                    270     // iCopy(LLI_COPY_TURN) 270¯
  119.  
  120. // Palettes
  121. #define LLI_PALETTE_SHARED              0x1000
  122. #define LLI_PALETTE_EXCLUSIVE           0x2000
  123.  
  124. /***************************************************************************/
  125. /******************************* Functions *********************************/
  126. /***************************************************************************/
  127.  
  128. typedef DWORD ( EXPORTED * LLI_IDLE )   
  129.     (                                   
  130.         DWORD           dwType,         
  131.         long            lParam,         
  132.         LLOBJECT        lloImage,       
  133.         DWORD           dwAction,       
  134.         DWORD           dwDevice,       
  135.         DWORD           dwFormat,       
  136.         DWORD           dwUdfParam      
  137.     );
  138.  
  139.  
  140. LLOBJECT   EXPORTED                     
  141.     iGet    (                           
  142.         LLOBJECT        lloOwner,       
  143.         DWORD           dwDevice,       
  144.         DWORD           dwFormat,       
  145.         int             iX1,            
  146.         int             iY1,            
  147.         int             iX2,            
  148.         int             iY2,            
  149.         DWORD           dwPar1,         
  150.         DWORD           dwPar2,         
  151.         DWORD           dwPar3,         
  152.         DWORD           dwPar4,         
  153.         DWORD           dwPar5,         
  154.         DWORD           dwUdfParam      
  155.         );
  156.  
  157. DWORD           EXPORTED                
  158.     iPut    (                           
  159.         LLOBJECT        lloImage,       
  160.         int             iX1,            
  161.         int             iY1,            
  162.         int             iX2,            
  163.         int             iY2,            
  164.         DWORD           dwDevice,       
  165.         DWORD           dwFormat,       
  166.         int             iXr,            
  167.         int             iYr,            
  168.         DWORD           dwPar1,         
  169.         DWORD           dwPar2,         
  170.         DWORD           dwPar3,         
  171.         DWORD           dwPar4,         
  172.         DWORD           dwPar5,         
  173.         DWORD           dwUdfParam      
  174.         );
  175.  
  176. LLOBJECT   EXPORTED                     
  177.     iCopy   (                           
  178.         LLOBJECT        lloImgSrc,      
  179.         int             iX1,            
  180.         int             iY1,            
  181.         int             iX2,            
  182.         int             iY2,            
  183.         DWORD           dwType,         
  184.         DWORD           dwPar1,         
  185.         DWORD           dwPar2,         
  186.         DWORD           dwPar3,         
  187.         DWORD           dwPar4,         
  188.         DWORD           dwPar5,         
  189.         DWORD           dwUdfParam      
  190.         );
  191.